package com.schoolai.ai.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.schoolai.ai.mapper.SchoolAiPromptMapper;
import com.schoolai.ai.service.SchoolAiPromptService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.schoolai.entity.SchoolAiPrompt;
import com.schoolai.util.base.Result;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author bobby
 * @since 2025-09-28
 */
@Service
public class SchoolAiPromptServiceImpl extends ServiceImpl<SchoolAiPromptMapper, SchoolAiPrompt> implements SchoolAiPromptService {

    @Override
    public Result queryList(String serviceName) {
        QueryWrapper<SchoolAiPrompt> wrapper = new QueryWrapper();
        // 条件查询
        if(StringUtils.isNotEmpty(serviceName)) {
            wrapper.like("server_name",serviceName);
        }

        return Result.ok(baseMapper.selectList(wrapper));
    }
}
